package ${package.Service};


import ${superServiceClassPackage};

import ${package.Mapper}.${table.mapperName};
import ${package.ReqVoPackage}.*;
import ${package.RespVoPackage}.*;
import ${package.Entity}.*;

import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.ArrayList;

/**
 * <p>
 * ${table.comment!} 服务类
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
<#if kotlin>
interface ${table.serviceName} : ${superServiceClass}<${entity}>
<#else>
public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {

<#if buildType == 'BILL'>

    ${table.mapperName} mapper();

    /**
    * 创建
    *
    * @param ${billClassVariable}
    * @param items
    */
    void create(${billClass} ${billClassVariable}, List<${itemClass}> items);


</#if>

<#if buildType == 'ITEM'>

    ${table.mapperName} mapper();

    /**
    * 根据 ${foreignProperty} 查询
    *
    * @param ${foreignProperty}
    * @return
    */
    List<${itemClass}> listBy${firstLetterUpperForeignProperty}(String ${foreignProperty});


    /**
    * 根据 ${foreignProperty} 删除明细
    *
    * @param ${foreignProperty}
    * @return
    */
    Boolean deleteBy${firstLetterUpperForeignProperty}(String ${foreignProperty});


    /**
    * 根据 eq ${foreignProperty} , not in ids 删除明细
    *
    * @param ${foreignProperty}
    * @param ids
    * @return
    */
    Boolean deleteBy${firstLetterUpperForeignProperty}AndIdNotIn(String ${foreignProperty}, List<String> ids);

    /**
    *
    *  更新 items
    */
    void updateBillItems(String billId, List<${itemClass}> items);

</#if>

<#if buildType == 'NORMAL'>

    ${table.mapperName} mapper();

    /**
    * 创建
    *
    * @param ${entityVariable}
    *
    */
    void create(${entity} ${entityVariable});


</#if>
}
</#if>
